﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Jia:Calculate
    {
        public Jia(int sum1, int sum2)
        {
            this.Sum1 = sum1;
            this.Sum2 = sum2;

        }
        public Jia(){ }
        public override void DisplayResult()
        {
            this.Sum3 = this.Sum1 + this.Sum2;
            Console.WriteLine("计算结果为"+this.Sum3);
        }

    }
    class Jian : Calculate
    {
        public Jian(int sum1, int sum2)
        {
            this.Sum1 = sum1;
            this.Sum2 = sum2;

        }
        public Jian() { }
        public override void DisplayResult()
        {
            if (this.Sum1>this.Sum2)
            {
                this.Sum3 = this.Sum1 - this.Sum2;
            }
            else
            {
                this.Sum3 = this.Sum2 - this.Sum1;
            }
            Console.WriteLine("计算结果为" + this.Sum3);
        }

    }
    class Cheng : Calculate
    {
        public Cheng(int sum1, int sum2)
        {
            this.Sum1 = sum1;
            this.Sum2 = sum2;

        }
        public Cheng() { }
        public override void DisplayResult()
        {
         
            this.Sum3 = this.Sum2 * this.Sum1;
           
            Console.WriteLine("计算结果为" + this.Sum3);
        }

    }
    class Chu : Calculate
    {
        public Chu(int sum1, int sum2)
        {
            this.Sum1 = sum1;
            this.Sum2 = sum2;

        }
        public Chu() { }
        public override void DisplayResult()
        {

            this.Sum3 = this.Sum2/this.Sum1;

            Console.WriteLine("计算结果为" + this.Sum3);
        }

    }
}
